/*
 * Copyright 2019-2021 shoprh.com. All rights reserved.
 * Support: http://www.shoprh.com
 * License: http://www.shoprh.com/license
 */
package com.shoprh.shop.domain;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.shoprh.common.core.domain.BaseEntity;
import lombok.Data;

import java.util.Date;

/**
 * Domain - 广告
 *
 * @author 若狐 Team
 * @version 1.0
 */
@Data
@TableName(value = "rh_ad")
public class Ad extends BaseEntity<Ad> {
    private static final long serialVersionUID = 1L;

    /**
     * 类型
     */
    public enum Type implements IEnum<Integer> {

        /**
         * 文本
         */
        text("文本", 0),

        /**
         * 图片
         */
        image("图片", 1);

        private String name;

        private int value;

        Type(String name, int value) {
            this.name = name;
            this.value = value;
        }

        @Override
        public Integer getValue() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    /**
     * 标题
     */
    private String title;

    /**
     * 类型
     */
    private Type type;

    /**
     * 起始日期
     */
    private Date beginDate;

    /**
     * 内容
     */
    private String content;

    /**
     * 结束日期
     */
    private Date endDate;

    /**
     * 路径
     */
    private String path;

    /**
     * 链接地址
     */
    private String url;

    /**
     * 排序
     */
    private Integer orderNum;

    /**
     * 广告位Id
     */
    private Long adPositionId;

    /**
     * 广告位对象
     */
    @TableField(exist = false)
    private AdPosition adPosition;

}
